package com.cslc.edas.demo.client.callback;

import com.alibaba.boot.hsf.annotation.AsyncOn;
import com.cslc.edas.demo.service.IAsyncService;
import com.taobao.hsf.exception.HSFException;
import com.taobao.hsf.tbremoting.invoke.CallbackInvocationContext;
import com.taobao.hsf.tbremoting.invoke.HSFResponseCallback;

@AsyncOn(interfaceName = IAsyncService.class, methodName = "callback")
public class AsyncEchoResponseCallBack implements HSFResponseCallback {
    @Override
    public void onAppException(Throwable throwable) {
        throwable.printStackTrace();
    }

    @Override
    public void onAppResponse(Object o) {
        Object obj=CallbackInvocationContext.getContext();

        System.out.println((String) obj+","+o);
    }

    @Override
    public void onHSFException(HSFException e) {
        e.printStackTrace();
    }
}
